﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>欢迎登录企业微信管理系统</title>
    <link href="/ViewV5/webn/css/style.css" rel="stylesheet" type="text/css" />
    <script language="JavaScript" src="/ViewV5/webn/js/jquery.js"></script>
    <script src="/ViewV5/webn/js/cloud.js" type="text/javascript"></script>

    <script language="javascript">
        $(function () {
            $('.loginbox').css({ 'position': 'absolute', 'left': ($(window).width() - 692) / 2 });
            $(window).resize(function () {
                $('.loginbox').css({ 'position': 'absolute', 'left': ($(window).width() - 692) / 2 });
            })
            var ComID = "";
            var SelTypeId = 0;
            var userid = getQueryString("userid", "");
            var sign = getQueryString("sign", "");
            if (userid && sign) {
                $.getJSON('/API/VIEWAPI.ashx?Action=Commanage_RTXDL', { P1: getQueryString("userid"), P2: getQueryString("sign"), "ComID": ComID }, function (resultData) {
                    if (resultData.ErrorMsg == "") {
                        setCookie('szhlcode', resultData.Result);
                        location.href = "/ViewV5/index.html";
                        setCookie('username', resultData.Result1, 20000);
                    } else {
                        alert(resultData.ErrorMsg);
                        $(".uppercase").text("登录")
                    }
                })
            }

            $(".uppercase").click(function (e) {

                e.preventDefault();
                $(".uppercase").text("正在登陆")
                $.getJSON('/API/VIEWAPI.ashx?Action=Commanage_YDL', { P2: $(".loginpwd").val(), P1: $(".loginuser").val(), "ComID": ComID }, function (resultData) {
                    if (resultData.ErrorMsg == "") {
                        setCookie('szhlcode', resultData.Result);
                        location.href = "/ViewV5/index.html";
                        setCookie('username', resultData.Result1, 20000);
                    } else {
                        alert(resultData.ErrorMsg);
                        $(".uppercase").text("登录")
                    }
                })
            });



        });
        function setCookie(name, value) {

            var Days = 30;
            var exp = new Date();
            exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
            document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString() + ";path=/";

        }

        function getQueryString(name, defauval) {
            //获取URL参数,如果获取不到，返回默认值，如果没有默认值，返回空格
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) { return unescape(r[2]); }
            else {
                return defauval || "";
            }
        }
    </script>

</head>

<body style="background-color: #1c77ac; background-image: url(images/light.png); background-repeat: no-repeat; background-position: center top; overflow: hidden;">

    <div id="mainBody">
        <div id="cloud1" class="cloud"></div>
        <div id="cloud2" class="cloud"></div>
    </div>


    <div class="logintop">
        <span>欢迎登录后台管理界面平台</span>
        <ul>
        </ul>
    </div>

    <div class="loginbody">

        <h1 style="text-align: center; margin-top: 120px; font-size: 30px; color: #FFF">欢迎登录企业微信管理系统</h1>

        <div class="loginbox" style="margin-top: 20px">

            <ul>
                <li>
                    <input name="" type="text" class="loginuser" placeholder="账号" onclick="JavaScript: this.value = ''" /></li>
                <li>
                    <input name="" type="password" class="loginpwd" placeholder="密码" onclick="JavaScript: this.value = ''" /></li>
                <li>
                    <input name="" type="button" class="loginbtn uppercase" id="uppercase" value="登录" /></li>
            </ul>


        </div>

    </div>



    <div class="loginbm">版权所有  2018</div>


</body>

</html>
